<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        fieldset{
            width:300px ;
            height: 800px;

        }
        .img1{
            width: 100px;
            height: 80px;
            background: url("img/tx.jpg");
        }
        .img2{
            width: 200px;
            height: 150px;
            background: url("img/tx.jpg");
            background-size: cover;
            margin-top: 60px;
        }
        .img3{
            width: 200px;
            height: 400px;
            background: url("img/tx.jpg") no-repeat;
            background-size: contain;
            margin-top: 60px;
        }

    </style>
</head>
<body>
<fieldset>
    <legeng>background-size: </legeng>
    <div class="img1"></div>
    <div class="img2"></div>
    <div class="img3"></div>
</fieldset>


</body>
</html>